﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class SCA_Client : Form
    {
        #region Position Define
        const int START_DailyRegisterElement_X = 420;
        const int START_DailyRegisterElement_Y = 10;
        const int SIZE_DailyRegisterElement_X = 470;
        const int SIZE_DailyRegisterElement_Y = 90;
        const int SEPARATE_DailyRegisterElement_Y = 10;
        const int MAX_DAY_REGISTER = 7;

        TimeSpan DAY_OFFSET = new TimeSpan(1, 0, 0, 0);

        #endregion

        public DailyRegisterElement[] NewDate;
        public REGISTER_LIST List_Register;

        public SCA_Client()
        {
            int i;
            int size_x, size_y, pos_x, pos_y;
            DateTime cur_date;

            InitializeComponent();

            List_Register = new REGISTER_LIST();
            List_Register.Class_Init(6, START_DailyRegisterElement_Y + SEPARATE_DailyRegisterElement_Y);
            WeeklyRegisterTab.Controls.Add(List_Register.GroupBox);
            List_Register.EmplTable.Rows.Add("20090066", "Nuyentrnmafdnfds Trung Kien");


            NewDate = new DailyRegisterElement[MAX_DAY_REGISTER];
            cur_date = DateTime.Now;
            for (i = 0; i < MAX_DAY_REGISTER; i++)
            {
                size_x = SIZE_DailyRegisterElement_X;
                size_y = SIZE_DailyRegisterElement_Y;
                pos_x = START_DailyRegisterElement_X;
                pos_y = START_DailyRegisterElement_Y + SIZE_DailyRegisterElement_Y * i + SEPARATE_DailyRegisterElement_Y;
                NewDate[i] = new DailyRegisterElement();
                NewDate[i].Init_Class(cur_date, size_x, size_y, pos_x, pos_y);
                WeeklyRegisterTab.Controls.Add(NewDate[i].GroupBox);
                cur_date = cur_date + DAY_OFFSET;
            }
        }
    }
}
